<%@ page import="com.cms.archives.CmsArticle" %>



<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'content', 'error')} required">
	<label for="content">
		<g:message code="cmsArticle.content.label" default="Content" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="content" required="" value="${cmsArticleInstance?.content}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'title', 'error')} required">
	<label for="title">
		<g:message code="cmsArticle.title.label" default="Title" />
		<span class="required-indicator">*</span>
	</label>
	<g:textArea name="title" cols="40" rows="5" maxlength="1000" required="" value="${cmsArticleInstance?.title}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'summary', 'error')} ">
	<label for="summary">
		<g:message code="cmsArticle.summary.label" default="Summary" />
		
	</label>
	<g:textArea name="summary" cols="40" rows="5" maxlength="2000" value="${cmsArticleInstance?.summary}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'category', 'error')} ">
	<label for="category">
		<g:message code="cmsArticle.category.label" default="Category" />
		
	</label>
	<g:select name="category" from="${com.cms.archives.CmsCategory.list()}" multiple="multiple" optionKey="id" size="5" value="${cmsArticleInstance?.category*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'changedOn', 'error')} required">
	<label for="changedOn">
		<g:message code="cmsArticle.changedOn.label" default="Changed On" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="changedOn" precision="day"  value="${cmsArticleInstance?.changedOn}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'comment', 'error')} ">
	<label for="comment">
		<g:message code="cmsArticle.comment.label" default="Comment" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${cmsArticleInstance?.comment?}" var="c">
    <li><g:link controller="cmsComment" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="cmsComment" action="create" params="['cmsArticle.id': cmsArticleInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'cmsComment.label', default: 'CmsComment')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: cmsArticleInstance, field: 'createdOn', 'error')} required">
	<label for="createdOn">
		<g:message code="cmsArticle.createdOn.label" default="Created On" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="createdOn" precision="day"  value="${cmsArticleInstance?.createdOn}"  />
</div>

